package com.qingke.OMS.Command.Imp;

import java.util.List;

import com.qingke.OMS.Command.Command;
import com.qingke.OMS.Dao.GoodsDao;

import com.qingke.OMS.Pojo.Goods;

import com.qingke.OMS.Unit.Console;

public class checkGoodsByName implements Command{

	@Override
	public void execute() {
		 
	GoodsDao gdao = new GoodsDao();
    String pname=Console.askUserInput("Please enter what you want to check of name?");

	 List<Goods> goods2=gdao.getGoodsByPname(pname);
	   if(goods2==null){
	    	Console.println("Invalid quetion name!");
	        return ;
	    }
	 for (Goods gd2 : goods2) {
		System.out.println(gd2);
	}
}
	

}
